<div class="box box-info">
    <div class="box-header with-border">
        <h3 class="box-title"></h3>
        <div class="box-tools">
            <div class="btn-group pull-right" style="margin-right: 10px">
                <a href="{{ route('products.index') }}" class="btn btn-sm btn-default"><i class="fa fa-list"></i>
                    列表</a>
            </div>
        </div>
    </div>
    <div class="box-body">
        <table class="table table-bordered">
            <tbody>
            <tr>
                <td>产品名：</td>
                <td colspan="2">{{ $product->name }}</td>
            </tr>
            <tr>
                <td>简介：</td>
                <td colspan="2">{{ $product->description }}</td>
            </tr>
            <tr>
                <td>图片：</td>
                <td colspan="2">
                    <img style="height:50px;" src="{{asset('storage/' . $product->image) }}">
                </td>
            </tr>
            <tr>
                <td>价格：</td>
                <td colspan="2">{{ $product->price }}</td>
            </tr>
            <tr>
                <td rowspan="{{ $product->skus->count() + 1 }}">SKU:</td>
                <td>类型</td>
                <td>价格</td>
            </tr>
            @foreach($product->skus as $sku)
                <tr>
                    <td>
                    @foreach(json_decode($sku->type) as $key=>$val)
                            {{$key}} : <button class="btn btn-xs btn-primary"> {{ $val }}</button>
                        @endforeach
                    </td>
                    <td>{{ $sku->price }}</td>
                </tr>
            @endforeach
            </tbody>
        </table>
    </div>
</div>